<%@ page contentType="text/html; charset=UTF-8" pageEncoding="utf-8"%>
<%@ include file="/common/init.jsp"%>
<link href="<c:url value='/admin/css/custom.css'/>" rel="stylesheet" type="text/css" />
<link href="<c:url value='/admin/css/style.css'/>" rel="stylesheet" type="text/css" />
<script src="<c:url value='/resources/js/jquery-1.7.2.min.js"'/>"></script>
<script type="text/javascript">
function handleComplain() {
	$("#button").val("提交中");
	$("#button").attr("disabled","disabled");
	var data = $("#complainForm").serialize();
	//alert(data);
	jQuery.ajax({
		url: "${ctx}/admin/handlecomplain.action",
		type: "post",
		dataType:"html",
		data:data,
	    async:false,  // 设置同步方式
	    cache:false,
		success: function(jsondata){
			alert(jsondata);
			self.location.href = "${ctx}/admin/eplist.action";
		},
		error: function(XMLHttpRequest, textStatus, errorThrown) {
	    }
	});
}

</script>
<style type="text/css">
<!--
body {
	background: #ffffff;
	margin-top:10px;
	margin-left:5px;
	margin-right:5px;
}
-->
</style>
<body>
<div class="EpmsSubTitle"><p><b>EP投诉</b></p>
</div>
<form id="complainForm" method="post">
<table width="100%" border="0" cellspacing="0" cellpadding="0" class="EpmsTable">
	<%-- <tr>
		<td class=EpmsTdTitle width="15%">卖方</td>
		<td class="EpmsTdNoColor" width="85%">
			<input type="text" id="title" name="msg.title" value="${msg.title}"/>
		</td>
	</tr>
	<tr>
		<td class=EpmsTdTitle>买方</td>
		<td class="EpmsTdNoColor">
			<select name="msg.type" id="msgType" style="width: 145px;">
              <c:forEach var="ms" items="${mailList}">
              	<option value="${ms.code}">${ms.name}</option>
			  </c:forEach>
	        </select>
		</td>
	</tr>
	<tr>
		<td class=EpmsTdTitle>收件人</td>
		<td class="EpmsTdNoColor">
			<input type="text" id="receiveId" name="msg.receiveId" value="${msg.sendId}"/>
			<input type="hidden" id="replyId" name="msg.replyId" value="${msg.id}"/>
		</td>
	</tr> --%>
	<tr>
		<td class=EpmsTdTitle>投诉人</td>
		<td class="EpmsTdNoColor">${epComplain.userId}</td>
	</tr>
	<tr>
		<td class=EpmsTdTitle width="15%">投诉时间</td>
		<td class="EpmsTdNoColor" width="85%">
		<input type="hidden" name="epComplain.id" value="${epComplain.id}"/>
			<fmt:formatDate value="${epComplain.createDate}" pattern="yyyy-M-dd HH:mm:ss"/>
		</td>
	</tr>
	<tr>
		<td class=EpmsTdTitle>投诉内容</td>
		<td class="EpmsTdNoColor">
			<textarea rows="10" cols="80" name="epComplain.content" readonly="readonly">${epComplain.content}</textarea>
		</td>
	</tr>
	<tr>
		<td class=EpmsTdTitle>附件凭证</td>
		<td class="EpmsTdNoColor">
			<a href="${ctx}/download.action?inputPath=${epComplain.attPath}&downloadFileName=${epComplain.attName}&_isExternal=true">${epComplain.attName}</a>
		</td>
	</tr>
	<tr>
		<td class=EpmsTdTitle>处理结果</td>
		<td class="EpmsTdNoColor">
			<textarea name="epComplain.result" rows="10" cols="80" <c:if test="${epComplain.handle eq '0'}">readonly</c:if>>${epComplain.result}</textarea>
		</td>
	</tr>
	<tr>
		<td colspan="2" align="center">
		<c:if test="${epComplain.handle eq '1'}"><!-- 未处理 -->
			<input type="button" name="button" id="button" value="处理" class="inputSubmit" onclick="handleComplain();"/>
		</c:if>
		<c:if test="${epComplain.handle eq '0'}">已处理&nbsp;&nbsp;
			<input type="button" name="button" value="返回" class="inputSubmit" onclick="history.back();"/>
		</c:if>
		</td>
	</tr>
</table>
</form>
</body>